package com.yuzhyn.hiops.app.application.controller.sys;

import com.yuzhyn.hiops.app.application.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("i/test")
public class TestController {

    @Autowired
    TestService testService;

    @GetMapping("/gc")
    public String gc() {
        log.info("启动gc测试");
        testService.gctest();
        return "DONE";
    }

    @GetMapping("/gca")
    public String gca() {
        log.info("启动gca测试");
        testService.gca();
        return "DONE";
    }

    @GetMapping("/sleep")
    public String sleep() throws InterruptedException {
        Thread.sleep(60 * 1000);
        return "SLEEP";
    }
}
